Integrand size = 26, antiderivative size = 86 \[ \int \frac {(e \cos (c+d x))^m}{a+i a \tan (c+d x)} \, dx=-\frac {i 2^{-1-\frac {m}{2}} (e \cos (c+d x))^m \operatorname {Hypergeometric2F1}\left (-\frac {m}{2},\frac {4+m}{2},1-\frac {m}{2},\frac {1}{2} (1-i \tan (c+d x))\right ) (1+i \tan (c+d x))^{m/2}}{a d m} \]
[Out]
Time = 0.29 (sec) , antiderivative size = 86, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.192, Rules used = {3596, 3586, 3604, 72, 71} \[ \int \frac {(e \cos (c+d x))^m}{a+i a \tan (c+d x)} \, dx=-\frac {i 2^{-\frac {m}{2}-1} (1+i \tan (c+d x))^{m/2} (e \cos (c+d x))^m \operatorname {Hypergeometric2F1}\left (-\frac {m}{2},\frac {m+4}{2},1-\frac {m}{2},\frac {1}{2} (1-i \tan (c+d x))\right )}{a d m} \]
[In]
[Out]
Rule 71
Rule 72
Rule 3586
Rule 3596
Rule 3604
Rubi steps \begin{align*} \text {integral}& = \left ((e \cos (c+d x))^m (e \sec (c+d x))^m\right ) \int \frac {(e \sec (c+d x))^{-m}}{a+i a \tan (c+d x)} \, dx \\ & = \left ((e \cos (c+d x))^m (a-i a \tan (c+d x))^{m/2} (a+i a \tan (c+d x))^{m/2}\right ) \int (a-i a \tan (c+d x))^{-m/2} (a+i a \tan (c+d x))^{-1-\frac {m}{2}} \, dx \\ & = \frac {\left (a^2 (e \cos (c+d x))^m (a-i a \tan (c+d x))^{m/2} (a+i a \tan (c+d x))^{m/2}\right ) \text {Subst}\left (\int (a-i a x)^{-1-\frac {m}{2}} (a+i a x)^{-2-\frac {m}{2}} \, dx,x,\tan (c+d x)\right )}{d} \\ & = \frac {\left (2^{-2-\frac {m}{2}} (e \cos (c+d x))^m (a-i a \tan (c+d x))^{m/2} \left (\frac {a+i a \tan (c+d x)}{a}\right )^{m/2}\right ) \text {Subst}\left (\int \left (\frac {1}{2}+\frac {i x}{2}\right )^{-2-\frac {m}{2}} (a-i a x)^{-1-\frac {m}{2}} \, dx,x,\tan (c+d x)\right )}{d} \\ & = -\frac {i 2^{-1-\frac {m}{2}} (e \cos (c+d x))^m \operatorname {Hypergeometric2F1}\left (-\frac {m}{2},\frac {4+m}{2},1-\frac {m}{2},\frac {1}{2} (1-i \tan (c+d x))\right ) (1+i \tan (c+d x))^{m/2}}{a d m} \\ \end{align*}
Both result and optimal contain complex but leaf count is larger than twice the leaf count of optimal. \(433\) vs. \(2(86)=172\).
Time = 7.52 (sec) , antiderivative size = 433, normalized size of antiderivative = 5.03 \[ \int \frac {(e \cos (c+d x))^m}{a+i a \tan (c+d x)} \, dx=-\frac {2^{-m/2} \cos (c+d x) (e \cos (c+d x))^m \left (1-2 \cos ^2(c+d x)+i \sin (2 (c+d x))\right )^{m/2} \left (2^{m/2} (2+m) \operatorname {Hypergeometric2F1}\left (1+m,\frac {2+m}{2},2+m,2 \cos (c+d x) (\cos (c+d x)-i \sin (c+d x))\right ) ((\cos (c)-i \sin (c)) \sin (c) (i+\tan (d x)))^{m/2}-2 (1+m) \operatorname {Hypergeometric2F1}\left (-1-\frac {m}{2},\frac {m}{2},-\frac {m}{2},\frac {1}{2} (1+i \tan (c+d x))\right ) ((\cos (c)+i \sin (c)) \sin (c) (-i+\tan (d x)))^{m/2} (1-i \tan (c+d x))^{m/2}\right )}{a d (1+m) (2+m) \left (-i \sin (c+d x) \left (\left (1-2 \cos ^2(c+d x)+i \sin (2 (c+d x))\right )^{m/2} ((\cos (c)+i \sin (c)) \sin (c) (-i+\tan (d x)))^{m/2}-((\cos (c)-i \sin (c)) \sin (c) (i+\tan (d x)))^{m/2}\right )+\cos (c+d x) \left (\left (1-2 \cos ^2(c+d x)+i \sin (2 (c+d x))\right )^{m/2} ((\cos (c)+i \sin (c)) \sin (c) (-i+\tan (d x)))^{m/2}+((\cos (c)-i \sin (c)) \sin (c) (i+\tan (d x)))^{m/2}\right )\right ) (-i+\tan (c+d x))} \]
[In]
[Out]
\[\int \frac {\left (e \cos \left (d x +c \right )\right )^{m}}{a +i a \tan \left (d x +c \right )}d x\]
[In]
[Out]
\[ \int \frac {(e \cos (c+d x))^m}{a+i a \tan (c+d x)} \, dx=\int { \frac {\left (e \cos \left (d x + c\right )\right )^{m}}{i \, a \tan \left (d x + c\right ) + a} \,d x } \]
[In]
[Out]
\[ \int \frac {(e \cos (c+d x))^m}{a+i a \tan (c+d x)} \, dx=- \frac {i \int \frac {\left (e \cos {\left (c + d x \right )}\right )^{m}}{\tan {\left (c + d x \right )} - i}\, dx}{a} \]
[In]
[Out]
Exception generated. \[ \int \frac {(e \cos (c+d x))^m}{a+i a \tan (c+d x)} \, dx=\text {Exception raised: RuntimeError} \]
[In]
[Out]
\[ \int \frac {(e \cos (c+d x))^m}{a+i a \tan (c+d x)} \, dx=\int { \frac {\left (e \cos \left (d x + c\right )\right )^{m}}{i \, a \tan \left (d x + c\right ) + a} \,d x } \]
[In]
[Out]
Timed out. \[ \int \frac {(e \cos (c+d x))^m}{a+i a \tan (c+d x)} \, dx=\int \frac {{\left (e\,\cos \left (c+d\,x\right )\right )}^m}{a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}} \,d x \]
[In]
[Out]